package com.party.core.dao.read.commune;

import com.party.common.paging.Page;
import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.commune.CMemberIntegralBalanceLog;
import com.party.core.model.commune.CUserIntegral;
import com.party.core.model.commune.CUserIntegralMobileOutput;
import com.party.core.model.commune.CUserIntegralOutput;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @program: party
 * @description: 用户积分数据读取接口
 * @author: Hua Qunhao
 * @create: 2019-08-12 14:24
 **/
public interface CUserIntegralReadDao extends BaseReadDao<CUserIntegral> {

    List<CUserIntegralOutput> queryUserIntegralList(@Param("params") Map<String, Object> params, Page page);

    Double getUserItemFractionSum(CUserIntegral cUserIntegral);

    //    @DataAuthParam(moduleType="MEMBERMGMT" ,field="partner_id",alias="pm")
    Double getUserItemFractionSumWithParams(@Param("params") Map<String, Object> params);

    List<CUserIntegralMobileOutput> queryUserIntegralMobileList(@Param("params") Map<String, Object> params, Page page);

    CUserIntegralMobileOutput queryUserIntegralMobile(@Param("params") Map<String, Object> params);

    List<CUserIntegralMobileOutput> queryIntegralInfluenceRankingList(@Param("params") Map<String, Object> params, Page page);

    /***
     * web端查询影响力排行
     * @Date 11:42 2019/10/14
     * @param params
     * @param page
     * @return
     **/
//    @DataAuthParam(moduleType="MEMBERMGMT" ,field="partner_id",alias="pm")
    List<CUserIntegralMobileOutput> queryIntegralInfluenceRankingListWithWeb(@Param("params") Map<String, Object> params, Page page);


    CUserIntegralMobileOutput queryIntegralInfluenceRanking(@Param("params") Map<String, Object> params);

    /**
     * @Description:获取我推荐的人
     * @Param:
     * @return:
     * @Author: Hua Qunhao
     * @Date: 2019/9/9
     */
    List<CUserIntegralMobileOutput> getRecommendPersonList(@Param("params") Map<String, Object> params, Page page);

    /**
     * @Description:获取推荐人的影响力
     * @Param:a
     * @return:a
     * @Author: Hua Qunhao
     * @Date: 2019/9/9
     */
    Double getRecommendItemFractionSum(@Param("parentId") String parentId, @Param("typeId") String typeId);

    /***
     * 过滤获取影响力总分
     * @Date 10:16 2019/10/15
     * @param params
     * @return
     **/
//    @DataAuthParam(moduleType="MEMBERMGMT" ,field="partner_id",alias="pm")
    Double getRecommendItemFractionSumWithParam(@Param("params") Map<String, Object> params);

    /***
     * web端获取积分排行榜
     * @Date 11:31 2019/11/12
     * @param params
     * @param page
     * @return
     **/
//    @DataAuthParam(moduleType="MEMBERMGMT" ,field="partner_id",alias="pm")
    List<CUserIntegralMobileOutput> queryUserIntegralWebList(@Param("params") Map<String, Object> params, Page page);

    /**
     * 根据pmId分组查pmId
     *
     * @return pmId列表
     * @author yifeng
     * @date 16:47 2019/11/13
     **/
    List<String> groupByPmIdList();

    Double getMemberGroupScoreByTypeId(@Param("memberGroupIds") List<String> memberGroupIds, @Param("params") Map<String, Object> params);

    List<CMemberIntegralBalanceLog> queryUserIntegralAll(@Param("params") Map<String, Object> params);
}